<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //startWidth():表示参数字符串是否在原字符串的头部，返回布尔值
        //endsWidth():表示参数字符是否在原字符串的尾部，返回布尔值

        let str = 'Hello ECMAScript 2015';
        let r1 = str.startsWith('Hello')
        console.log(r1);
        let r2 = str.endsWith('2015');
        console.log(r2);
    </script>
</body>

</html>